------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/nagler/Dropbox/EconvoteDrop/Replication_APR2017/figure2_code.log
  log type:  text
 opened on:  10 Mar 2017, 14:04:24

. *************************************************************************;
. *  File-Name:   figure2_code.do                                         *;
. *  Date:        May 31, 2016                                            *;
. *               March 9, 2017 - Run for Replication                     *;
. *  Author:      JN (from earlier version by SL)                         *;
. *  Purpose:     Graph share of income by Quintile                       *;
. *               Produce figure2 from Linn and Nagler, APR 2017          *;
. *  Data In:     econdata_2013_geoW_D_REP.dta                            *;
. *  Prev File:   graph_sj_JN3.do                                         *;
. *  Machine:     Nagler-iMac                                             *;
. *  Status:      Replication Code                                        *;
. *************************************************************************;
. *************************************************************************;
. * Read in Economic Data         *;
. *************************************************************************;
. global path "~/dropbox/EconvoteDrop/Replication_APR2017/Graphs_Figure2";

. * use ~/Dropbox/EconvoteDrop/Data/Make_econ_quintiles/econdata_2013_geoW_D.dta *;
. use econdata_2013_geoW_D_REP.dta;

. summarize;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        year |        264      1979.5    19.08655       1947       2012
         qrt |        265     2.50566    1.121825          1          4
       qdate |        264        79.5    76.35444        -52        211
   famq1mean |         66     14572.9    3540.478   6769.575      18829
   famq2mean |         66    33958.06    7333.062   17901.76      43052
-------------+---------------------------------------------------------
   famq3mean |         66    51843.59    12796.25   26025.25      68042
   famq4mean |         66    73705.27    20798.17   35352.23     101748
   famq5mean |         66    138170.2    48080.94   64235.75     213399
share_q1_est |         66    .0475857    .0056152   .0375023   .0571008
share_q2_est |         66    .1116748    .0110912    .092184       .127
-------------+---------------------------------------------------------
share_q3_est |         66    .1685219    .0098797   .1506838       .181
share_q4_est |         66    .2367362    .0048621   .2274217   .2461823
share_q5_est |         66     .436176    .0289013       .404    .489019

. *************************************************************************;
. * Graph ESTIMATED shares of family income               *;
. *************************************************************************;
. twoway (tsline share_q1_est, 
>         recast(line)), title(Share of Income - Bottom Quintile) 
>         ttitle(Year) subtitle() 
>         legend(order(1 "Bottom Quintile")) 
>         ylabel(#3) xlabel(#3)
>         ytitle(Share of Family Income) saving("$path/Q1", replace);
(file ~/dropbox/EconvoteDrop/Replication_APR2017/Graphs_Figure2/Q1.gph saved)

.         graph export "$path/Est_Share_of_Income_1952_2012_Q1.pdf", replace;
(file /Users/nagler/dropbox/EconvoteDrop/Replication_APR2017/Graphs_Figure2/Est_Share_of_Income_1952_2012_Q1.pdf written
>  in PDF format)

. twoway (tsline share_q2_est, 
>         recast(line)), title(Share of Income - Second Quintile) 
>         ttitle(Year) subtitle() 
>         legend(order(1 "Quintile Two")) 
>         xlabel(#5) ylabel(#3)
>         ytitle(Share of Family Income) saving("$path/Q2", replace);
(file ~/dropbox/EconvoteDrop/Replication_APR2017/Graphs_Figure2/Q2.gph saved)

.         graph export "$path/Est_Share_of_Income_1952_2012_Q2.pdf", replace;
(file /Users/nagler/dropbox/EconvoteDrop/Replication_APR2017/Graphs_Figure2/Est_Share_of_Income_1952_2012_Q2.pdf written
>  in PDF format)

. twoway (tsline share_q3_est, 
>         recast(line)), title(Share of Income - Third Quintile) 
>         ttitle(Year) subtitle() 
>         legend(order(1 "Quintile Three")) 
>         xlabel(#5) ylabel(#3)
>         ytitle(Share of Family Income) saving("$path/Q3", replace);
(file ~/dropbox/EconvoteDrop/Replication_APR2017/Graphs_Figure2/Q3.gph saved)

.         graph export "$path/Est_Share_of_Income_1952_2012_Q3.pdf", replace;
(file /Users/nagler/dropbox/EconvoteDrop/Replication_APR2017/Graphs_Figure2/Est_Share_of_Income_1952_2012_Q3.pdf written
>  in PDF format)

. twoway (tsline share_q4_est, 
>         recast(line)), title(Share of Income - Fourth Quintile) 
>         ttitle(Year) subtitle() 
>         legend(order(1 "Quintile Four")) 
>         xlabel(#5) ylabel(#3)
>         ytitle(Share of Family Income) saving("$path/Q4", replace);
(file ~/dropbox/EconvoteDrop/Replication_APR2017/Graphs_Figure2/Q4.gph saved)

.         graph export "$path/Est_Share_of_Income_1952_2012_Q4.pdf", replace;
(file /Users/nagler/dropbox/EconvoteDrop/Replication_APR2017/Graphs_Figure2/Est_Share_of_Income_1952_2012_Q4.pdf written
>  in PDF format)

. twoway (tsline share_q5_est, 
>         recast(line)), title(Share of Income - Top Quintile) 
>         ttitle(Year) subtitle() 
>         legend(order(1 "Top Quintile")) 
>         xlabel(#5) ylabel(#3)
>         ytitle(Share of Family Income) saving("$path/Q5", replace);
(file ~/dropbox/EconvoteDrop/Replication_APR2017/Graphs_Figure2/Q5.gph saved)

.         graph export "$path/Est_Share_of_Income_1952_2012_Q5.pdf", replace;
(file /Users/nagler/dropbox/EconvoteDrop/Replication_APR2017/Graphs_Figure2/Est_Share_of_Income_1952_2012_Q5.pdf written
>  in PDF format)

. graph combine "$path/Q1" "$path/Q2" "$path/Q3" "$path/Q4" "$path/Q5" , cols(2);

.    graph export "$path/combined_income.pdf", replace;
(file /Users/nagler/dropbox/EconvoteDrop/Replication_APR2017/Graphs_Figure2/combined_income.pdf written in PDF format)

.  log close;
      name:  <unnamed>
       log:  /Users/nagler/Dropbox/EconvoteDrop/Replication_APR2017/figure2_code.log
  log type:  text
 closed on:  10 Mar 2017, 14:04:27
------------------------------------------------------------------------------------------------------------------------
